package com.msi.test;

import java.io.BufferedWriter;
import java.io.IOException;
import java.util.Vector;

public class MsiTestRecord {
    private int itNumber;
    private int numberOfVertices;
    private int numberOfEdges;
    private Vector<Integer> vNumberOfColors;
    private Vector<Long> vComputationTime;

    public MsiTestRecord(int itNumber, int numberOfVertices, int numberOfEdges) {
        this.itNumber = itNumber;
        this.numberOfEdges = numberOfEdges;
        this.numberOfVertices = numberOfVertices;
        vNumberOfColors = new Vector<Integer>();
        vComputationTime = new Vector<Long>();
    }

    public void addResult(int numberOfColors, Long computationTime) {
        vNumberOfColors.add(numberOfColors);
        vComputationTime.add(computationTime);
    }

    public int getNumberOfColors(int algId) {
        return vNumberOfColors.get(algId);
    }

    public double getComputationTime(int algId) {
        return vComputationTime.get(algId);
    }

    public int getItNumber() {
        return itNumber;
    }

    public int getNumberOfVertices() {
        return numberOfVertices;
    }

    public int getNumberOfEdges() {
        return numberOfEdges;
    }

    public void printRecord(BufferedWriter out) throws IOException {
        out.write(itNumber + "\t\t" + numberOfVertices + "\t\t" + numberOfEdges
                + "\t\t");
        for (Integer diff : vNumberOfColors) {
            out.write(diff + "\t\t");
        }
        for (Long time : vComputationTime) {
            out.write(time + "\t\t");
        }
        out.write("\n");
    }

}
